package com.android.duininsuoai.adapt;

import android.widget.ImageView;

import com.android.duininsuoai.model.detail.Pingjia;
import com.android.duininsuoai.utils.ObjectUtils;
import com.android.duininsuoai.R;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

/**
 * Created by Administrator on 2016/8/10.
 */
public class ListDetailCommentAdapt extends BaseQuickAdapter<Pingjia.PingjiaData.Pingjiadata, BaseViewHolder> {

    public ListDetailCommentAdapt(int layoutResId, List<Pingjia.PingjiaData.Pingjiadata> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder holder, Pingjia.PingjiaData.Pingjiadata pingjiadata) {

        holder.setText(R.id.item_item_detail_comment_name, pingjiadata.getNickname());
        holder.setText(R.id.item_item_detail_comment_time, pingjiadata.getC_time());
        holder.setText(R.id.item_item_detail_comment_comment, pingjiadata.getContent());
        int star = Integer.parseInt(pingjiadata.getStar());
        holder.setRating(R.id.item_item_detail_comment_star, star);
        ObjectUtils.photoCircle(mContext, pingjiadata.getAvatar(), (ImageView) holder.getView(R.id.item_item_detail_comment_img));
    }


}
